package cn.edu.imnu.controller;

import cn.edu.imnu.common.ResponseData;
import cn.edu.imnu.entry.vo.DrugListVo;
import cn.edu.imnu.service.DrugService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("meds")
public class MedsController {
    @Resource
    private DrugService drugService;

    @GetMapping("getMedsList")
    public ResponseData<List<DrugListVo>> getDrugList(){
        List<DrugListVo> drugList = drugService.getDruglist();
        return ResponseData.ok(drugList);
    }
}
